package lime.xquery.widget;

import lime.common.UIUtils;

import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;

public class XQueryErrorResult extends Composite {

	public XQueryErrorResult(Composite parent, int style) {
		super(parent, style);
		init();
	}

	private void init() {
		this.setLayout(new FillLayout());
	}
	
	public void update(String text) {

		UIUtils.clear(this);
		
		Text resultText = new Text(this, SWT.WRAP | SWT.MULTI | SWT.V_SCROLL);
		resultText.setFont(JFaceResources.getTextFont());
		resultText.setText(text);
		
		this.layout();
	}
	
}
